/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.toools.gwt.wmc.client.companypart.gui;

import org.toools.gwt.widget.client.bc.BasicControl;
import org.toools.gwt.widget.client.bc.BasicList;
import org.toools.gwt.widget.client.cloud.TagRenderer;
import org.toools.gwt.widget.client.cloud.TagVO;
import org.toools.gwt.wmc.jpa.CompanyPart;

/**
 *
 * @author Manuel
 */
public class CompanyPartList extends BasicList{

    public CompanyPartList(TagVO[] data, BasicControl bc) {
        super(data, bc);
    }

    @Override
    public TagRenderer createTagRenderer(TagVO tag) {
        return new CompanyPartListRenderer(tag, getBasicControl());
    }

    @Override
    public boolean filter(TagVO tag) {
        CompanyPart cp = (CompanyPart) tag.getAttachedBusinessObject();
		if(cp.getName().toLowerCase().contains(getFilter().toLowerCase())) {
			return true;
		}
		else {return false;}
    }

}
